package com.xgimi.open.skill.datamanager.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.xgimi.commons.base.Result;
import com.xgimi.open.skill.datamanager.biz.service.IntentBizService;
import com.xgimi.open.skill.datamanager.service.api.IntentRpcService;
import com.xgimi.open.skill.datamanager.service.request.InentReferenceSlotReqDTO;
import com.xgimi.open.skill.datamanager.service.request.IntentReqDTO;
import com.xgimi.open.skill.datamanager.service.response.IntentRespDTO;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author coderzpw.zhang
 * @version 1.0
 * @description 描述
 * @date 2023/3/3 14:23
 */
@Service
public class IntentRpcServiceImpl implements IntentRpcService {

    @Autowired
    private IntentBizService intentBizService;


    @Override
    public Result<Boolean> create(IntentReqDTO intentReqDTO) {
        Boolean ret = intentBizService.addInent(intentReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<List<IntentRespDTO>> list(IntentReqDTO intentReqDTO) {
        List<IntentRespDTO> result = intentBizService.list(intentReqDTO);
        return new Result<>(result);
    }

    @Override
    public Result<List<IntentRespDTO>> listBySkillVid(Long skillVid) {
        List<IntentRespDTO> result = intentBizService.listBySkillVid(skillVid);
        return new Result<>(result);
    }

    @Override
    public Result<Boolean> delete(IntentReqDTO intentReqDTO) {
        Boolean ret = intentBizService.deleteIntent(intentReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<Boolean> update(IntentReqDTO intentReqDTO) {
        Boolean ret = intentBizService.updateIntent(intentReqDTO);
        return new Result<>(ret);
    }

    @Override
    public Result<Boolean> referenceSlot(InentReferenceSlotReqDTO inentReferenceSlotReqDTO) {
        Boolean ret = intentBizService.referenceSlot(inentReferenceSlotReqDTO);
        return new Result<>(ret);
    }
}
